vectorization in python